﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Framework_Tool
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        StaffLogin stfLoginWindow;
        Student currentStudentUser;
        
        public MainWindow()
        {
            InitializeComponent();
            this.WindowState = WindowState.Maximized;
            
            //UserChoice userChoiceWindow = new UserChoice(this);
            //userChoiceWindow.Content = null;
            //mainContent.Children.Add(userChoiceWindow.mainContent);

            StaffLogin stfLoginWindow = new StaffLogin(this);
            stfLoginWindow.Content = null;
            mainContent.Children.Add(stfLoginWindow.mainContent);

            stfLoginWindow.stfPicBtn.Visibility = Visibility.Visible;
            stfLoginWindow.staffLoginPageBtn.Visibility = Visibility.Visible;
            stfLoginWindow.stdtPicBtn.Visibility = Visibility.Visible;
            stfLoginWindow.stdtLoginPageBtn.Visibility = Visibility.Visible;

            stfLoginWindow.stfLoginIcon.Visibility = Visibility.Hidden;
            stfLoginWindow.staffLogin.Visibility = Visibility.Hidden;
            stfLoginWindow.stfID.Visibility = Visibility.Hidden;
            stfLoginWindow.stfUsernameTxtGrid.Visibility = Visibility.Hidden;
            stfLoginWindow.password.Visibility = Visibility.Hidden;
            stfLoginWindow.stfPasswordTxtGrid.Visibility = Visibility.Hidden;
            stfLoginWindow.stfLoginBtnGrid.Visibility = Visibility.Hidden;
            stfLoginWindow.studentLoginBtnGrid.Visibility = Visibility.Hidden;
        }

        public void stfLogged_in()
        {
            currentStudentUser = new Student();
            welcomeTxtBlk.Visibility = Visibility.Hidden;
            detailsTxtBlk.Visibility = Visibility.Hidden;
            loggedInAsLbl.Visibility = Visibility.Visible;
            userLbl.Visibility = Visibility.Visible;
            menuPanel.Visibility = Visibility.Visible;
            logoutBtn.Visibility = Visibility.Visible;
        }

        public void stdtLogged_in()
        {
            welcomeTxtBlk.Visibility = Visibility.Hidden;
            detailsTxtBlk.Visibility = Visibility.Hidden;
            loggedInAsLbl.Visibility = Visibility.Visible;
            userLbl.Visibility = Visibility.Visible;
            learnerMenuPanel.Visibility = Visibility.Visible;
            logoutBtn.Visibility = Visibility.Visible;
        }

        private void coursesBtn_Click(object sender, RoutedEventArgs e)
        {
            CourseView crsViewWindow = new CourseView();
            crsViewWindow.Content = null;
            mainContent.Children.Add(crsViewWindow.mainContent);

            var converter = new System.Windows.Media.BrushConverter();
            var blackBrush = (System.Windows.Media.Brush)converter.ConvertFromString(System.Windows.Media.Color.FromRgb(29, 29, 29).ToString());

            coursesBtn.FontWeight = FontWeights.ExtraBold;
            unitsBtn.FontWeight = FontWeights.Normal;
            assessmentsBtn.FontWeight = FontWeights.Normal;
            staffBtn.FontWeight = FontWeights.Normal;
            studentsBtn.FontWeight = FontWeights.Normal;
            settingsBtn.FontWeight = FontWeights.Normal;
        }

        private void unitsBtn_Click(object sender, RoutedEventArgs e)
        {
            UnitView unitViewWindow = new UnitView();
            unitViewWindow.Content = null;
            mainContent.Children.Add(unitViewWindow.mainContent);

            coursesBtn.FontWeight = FontWeights.Normal;
            unitsBtn.FontWeight = FontWeights.ExtraBold;
            assessmentsBtn.FontWeight = FontWeights.Normal;
            staffBtn.FontWeight = FontWeights.Normal;
            studentsBtn.FontWeight = FontWeights.Normal;
            settingsBtn.FontWeight = FontWeights.Normal;
        }

        private void assessmentsBtn_Click(object sender, RoutedEventArgs e)
        {
            AssessmentView asmntViewWindow = new AssessmentView();
            asmntViewWindow.Content = null;
            mainContent.Children.Add(asmntViewWindow.mainContent);

            coursesBtn.FontWeight = FontWeights.Normal;
            unitsBtn.FontWeight = FontWeights.Normal;
            assessmentsBtn.FontWeight = FontWeights.ExtraBold;
            staffBtn.FontWeight = FontWeights.Normal;
            studentsBtn.FontWeight = FontWeights.Normal;
            settingsBtn.FontWeight = FontWeights.Normal;
        }

        private void staffBtn_Click(object sender, RoutedEventArgs e)
        {
            StaffView stfViewWindow = new StaffView();
            stfViewWindow.Content = null;
            mainContent.Children.Add(stfViewWindow.mainContent);

            coursesBtn.FontWeight = FontWeights.Normal;
            unitsBtn.FontWeight = FontWeights.Normal;
            assessmentsBtn.FontWeight = FontWeights.Normal;
            staffBtn.FontWeight = FontWeights.ExtraBold;
            studentsBtn.FontWeight = FontWeights.Normal;
            settingsBtn.FontWeight = FontWeights.Normal;
        }

        private void studentsBtn_Click(object sender, RoutedEventArgs e)
        {
            StudentView stdtViewWindow = new StudentView();
            stdtViewWindow.Content = null;
            mainContent.Children.Add(stdtViewWindow.mainContent);

            coursesBtn.FontWeight = FontWeights.Normal;
            unitsBtn.FontWeight = FontWeights.Normal;
            assessmentsBtn.FontWeight = FontWeights.Normal;
            staffBtn.FontWeight = FontWeights.Normal;
            studentsBtn.FontWeight = FontWeights.ExtraBold;
            settingsBtn.FontWeight = FontWeights.Normal;
        }

        private void settingsBtn_Click(object sender, RoutedEventArgs e)
        {
            SettingsAdd settingsAddWindow = new SettingsAdd();
            settingsAddWindow.Content = null;
            mainContent.Children.Add(settingsAddWindow.mainContent);

            coursesBtn.FontWeight = FontWeights.Normal;
            unitsBtn.FontWeight = FontWeights.Normal;
            assessmentsBtn.FontWeight = FontWeights.Normal;
            staffBtn.FontWeight = FontWeights.Normal;
            studentsBtn.FontWeight = FontWeights.Normal;
            settingsBtn.FontWeight = FontWeights.ExtraBold;
        }

        private void logoutBtn_Click(object sender, RoutedEventArgs e)
        {
            StaffLogin stfLoginWindow = new StaffLogin(this);
            stfLoginWindow.Content = null;
            mainContent.Children.Add(stfLoginWindow.mainContent);

            welcomeTxtBlk.Visibility = Visibility.Visible;
            detailsTxtBlk.Visibility = Visibility.Visible;
            loggedInAsLbl.Visibility = Visibility.Hidden;
            userLbl.Visibility = Visibility.Hidden;
            menuPanel.Visibility = Visibility.Hidden;
            logoutBtn.Visibility = Visibility.Hidden;
            learnerMenuPanel.Visibility = Visibility.Hidden;
        }

        private void CoursesBtn_lrnr_Click_1(object sender, RoutedEventArgs e)
        {

        }

        private void unitsBtn_lrner_Click_1(object sender, RoutedEventArgs e)
        {

        }

        private void staffDetailsBtn_lrner_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerStaffDetails lrnerStfDetailsWindow = new LearnerStaffDetails();
            lrnerStfDetailsWindow.Content = null;
            mainContent.Children.Add(lrnerStfDetailsWindow.mainContent);
        }

        private void takeAssessmentBtn_lrner_Click_1(object sender, RoutedEventArgs e)
        {
            TakeAssessment takeAsmntWindow = new TakeAssessment(this);
            takeAsmntWindow.Content = null;
            mainContent.Children.Add(takeAsmntWindow.mainContent);
        }

        private void profileBtn_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerAssessmentProfile lrnerAsmntProfileWindow = new LearnerAssessmentProfile();
            lrnerAsmntProfileWindow.Content = null;
            mainContent.Children.Add(lrnerAsmntProfileWindow.mainContent);
        }   
    }
}